# 定义一个字符串变量
greeting = "Hello, World!"

# 打印变量的值
print("Greeting:", greeting)

# 获取字符串的长度
length = len(greeting)
print("Length of the greeting:", length)

# 访问字符串中的特定字符
first_char = greeting[0]
print("First character of the greeting:", first_char)

# 切片操作提取子字符串
substring = greeting[7:12]
print("Substring from index 7 to 11:", substring)

# 判断字符串是否包含某个子串
if "World" in greeting:
    print("The greeting contains 'World'.")
else:
    print("The greeting does not contain 'World'.")
